package Demo;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Demo08 {
    public static void main(String[] args) throws IOException {
        InputStream is = new FileInputStream("./文本.txt");
        while (true) {
            byte[] b = new byte[1024];
            int len = is.read(b);
            if (len == -1) {
                break;
            }
            System.out.println("读取到字节数：" + len);
            for (int i = 0; i < len; i++) {
                System.out.println((char) b[i]);
            }
        }
        is.close();
    }
}
